﻿using System;
using UnityEngine;
using UnityEngine.SceneManagement;

// Token: 0x020005AD RID: 1453
public class AssetBundleLoadLevelOperation : global::AssetBundleLoadOperation
{
	// Token: 0x06002249 RID: 8777 RVA: 0x00136DB0 File Offset: 0x00134FB0
	public AssetBundleLoadLevelOperation(string assetbundleName, string levelName, bool isAdditive, string manifestAssetBundleName)
	{
		this.m_AssetBundleName = assetbundleName;
		this.m_LevelName = levelName;
		this.m_IsAdditive = isAdditive;
		this.m_ManifestAssetBundleName = manifestAssetBundleName;
	}

	// Token: 0x170003A4 RID: 932
	// (get) Token: 0x0600224A RID: 8778 RVA: 0x00136DD8 File Offset: 0x00134FD8
	public AsyncOperation Request
	{
		get
		{
			return this.m_Request;
		}
	}

	// Token: 0x0600224B RID: 8779 RVA: 0x00136DE0 File Offset: 0x00134FE0
	public override bool Update()
	{
		if (this.m_Request != null)
		{
			return false;
		}
		global::LoadedAssetBundle loadedAssetBundle = global::AssetBundleManager.GetLoadedAssetBundle(this.m_AssetBundleName, out this.m_DownloadingError, this.m_ManifestAssetBundleName);
		if (loadedAssetBundle != null)
		{
			this.m_Request = SceneManager.LoadSceneAsync(this.m_LevelName, (!this.m_IsAdditive) ? LoadSceneMode.Single : LoadSceneMode.Additive);
			return false;
		}
		return true;
	}

	// Token: 0x0600224C RID: 8780 RVA: 0x00136E40 File Offset: 0x00135040
	public override bool IsDone()
	{
		if (this.m_Request == null && this.m_DownloadingError != null)
		{
			global::Debug.LogError(this.m_DownloadingError);
			return true;
		}
		return this.m_Request != null && this.m_Request.isDone;
	}

	// Token: 0x04002B45 RID: 11077
	protected string m_AssetBundleName;

	// Token: 0x04002B46 RID: 11078
	protected string m_LevelName;

	// Token: 0x04002B47 RID: 11079
	protected bool m_IsAdditive;

	// Token: 0x04002B48 RID: 11080
	protected string m_DownloadingError;

	// Token: 0x04002B49 RID: 11081
	protected AsyncOperation m_Request;

	// Token: 0x04002B4A RID: 11082
	protected string m_ManifestAssetBundleName;
}
